// 获取当前日期
const currentDate = new Date();

// 获取今年的年份
const currentYear = currentDate.getFullYear();

// 计算去年和前年的年份
const lastYear = currentYear - 1;
const twoYearsAgo = currentYear - 2;

// 生成今年的日期范围
export const getCurrentYearRange = () =>
{
    return {
        startDate: `${currentYear}-01-01`,
        endDate: `${currentYear}-12-31`
    }
}

// 生成去年的日期范围
export const getLastYearRange = () =>
{
    return {
        startDate: `${lastYear}-01-01`,
        endDate: `${lastYear}-12-31`
    }
}

// 生成前年的日期范围
export const getBeforLastYearRange = () =>
{
    return {
        startDate: `${twoYearsAgo}-01-01`,
        endDate: `${twoYearsAgo}-12-31`
    }
}


